<template>
  <div class="cms-content" :class="{ 'is-mobile': $isMobile }">
    <div v-for="item in list" :key="item.id" @click="handleDetail(item)" class="cms-content-item">
      <i></i>
      <div>{{ item.title }}</div>

    </div>
  </div>
</template>

<script>
export default {
  props: ["list"],

  methods: {
    handleDetail(item) {
      if (item.link) {
        return window.open(item.link);
      }
      this.$router.push({
        path: `/article-detail/${item.articleId || item.id}`,
      });
    },
  },
};
</script>

<style lang="less" scoped>
.cms-content {
  padding: 20px;
  display: flex;
  width: 100%;
  flex-wrap: wrap;

  .cms-content-item {
    width: 50%;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #484848;
    height: 24px;
    text-align: left;
    font-style: normal;
    text-transform: none;
    margin-bottom: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-right: 20px;

    i {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: block;
      background-color: #b80720;
      margin-right: 10px;
    }
  }



}

.cms-content.is-mobile {
  padding: 0;

  .cms-content-item {
    width: 100%;
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 0;
    height: max-content;
    word-break: break-all;
    padding-right: 0;
    align-items: center;
    justify-content: space-between;

    i {
      display: none;
    }
  }
}</style>
